package com.pkx.cloud.fse7.dms.site.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pkx.cloud.fse7.dms.site.entity.DoorDeviceSite;
import com.pkx.cloud.fse7.dms.site.repo.DoorDeviceSiteMapper;
import com.pkx.cloud.fse7.dms.site.service.DoorDeviceSiteService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *  服务实现类
 *
 * @author chenwg
 * @since 2020-12-23
 */
@Service
@DS("slave")
public class DoorDeviceSiteServiceImpl extends ServiceImpl<DoorDeviceSiteMapper, DoorDeviceSite> implements DoorDeviceSiteService {

    /**
     * 分页列表
     *
     * @param doorDeviceSite
     * @return
     */
    @Override
    public Page<DoorDeviceSite> pageList(Page page, DoorDeviceSite doorDeviceSite) {
        LambdaQueryWrapper<DoorDeviceSite> lambdaQueryWrapper = Wrappers.lambdaQuery(DoorDeviceSite.class);
        return page(page, lambdaQueryWrapper);
    }

    /**
     * 列表查询
     *
     * @param doorDeviceSite
     * @return
     */
    @Override
    public List<DoorDeviceSite> listByEntity(DoorDeviceSite doorDeviceSite) {
        LambdaQueryWrapper<DoorDeviceSite> lambdaQueryWrapper = Wrappers.lambdaQuery(DoorDeviceSite.class);
        return list(lambdaQueryWrapper);
    }

    /**
     * 详情
     *
     * @param id
     * @return
     */
    @Override
    public DoorDeviceSite selectById(String id) {
        return getById(id);
    }

    /**
     * 保存
     *
     * @param doorDeviceSite
     * @return
     */
    @Override
    public Boolean saveDoorDeviceSite(DoorDeviceSite doorDeviceSite) {
        return save(doorDeviceSite);
    }

    /**
     * 修改
     *
     * @param doorDeviceSite
     * @return
     */
    @Override
    public Boolean modify(DoorDeviceSite doorDeviceSite) {
        return updateById(doorDeviceSite);
    }

    /**
     * 删除
     *
     * @param id
     * @return
     */
    @Override
    public Boolean deleteById(String id) {
        return removeById(id);
    }
}
